package com.cxyzy.customview

import android.content.Context
import android.util.AttributeSet
import android.view.LayoutInflater
import android.widget.LinearLayout
import kotlinx.android.synthetic.main.view_location.view.*

/**
 * 自定义view之组合view
 * 用于显示当前位置
 */
class LocationView(
    context: Context,
    attrs: AttributeSet?
) : LinearLayout(context, attrs) {
    init {
        initView(context)
    }

    private fun initView(context: Context) {
        LayoutInflater.from(context).inflate(R.layout.view_location, this, true)
    }

    fun setData(name: String?, address: String?) {
        name?.let { locationNameTv.text = it }
        address?.let { locationAddressTv.text = it }
    }
}